<template>
  <div style="padding: 5px;">
    <div style="font-size: 16px;" v-html="label"></div>
    <el-input v-if="isInput" v-model="inputContent" type="textarea" :rows="6" :placeholder="inputTip"></el-input>
    <div style="text-align: left ;font-size: 16px;padding: 5px">
      <i v-if="description!=''" :class="icon"></i> <span v-html="description"></span>
    </div>
  </div>
</template>

<script>

  export default {
    created() {
      var that = this;
      var initailText="";
      var parmsStr = Object.toQueryString("parms");
      var parms = {};
      if (parmsStr) {
        parmsStr = decodeURIComponent(parmsStr);
        parms = eval("(" + parmsStr + ")");
        initailText = parms.data || "";
      }
      that.label = parms.label || "";
      that.icon = parms.icon || "";
      that.description = parms.description || "";
      that.inputTip = parms.inputTip || "请填写内容";
      that.inputContent = parms.inputContent || "";
      if (parms.isInput === false) {
        that.isInput = false;
      }
    }
    , data() {
      return {
        label: "",
        //是否带填写输入框
        isInput: true,
        //输入框的提示
        inputTip: '',
        //输入框内容
        inputContent: '',
        //描述内容
        description: '',
        icon: ''
      };
    },
    methods: {
      getResult() {
        return this.inputContent;
      }
    }
    , mounted() {
      window.myvm = this;
    }
  }

  window.getResult= function() {
    return myvm.getResult();
  }
</script>